<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>给你的，就不会再给别人！！</title>
	<link rel="shortcut icon" href="https://static.hdslb.com/images/favicon.ico">
	<link rel="stylesheet" href="css/demo01.css">
</head>
<body>
	<div class="out">
		<div class="welcome"><p id="p">常回家看看啊！</p></div>
		<div class="jiantou"></div>
	</div>
	<div class="top">
		<div class="top-banner">
			<img src="https://s1.hdslb.com/bfs/static/passport/static/img/rl_top.35edfde.png" alt="">	
		</div>	
	</div>
	<div class="title-line"><span>登录</span></div>
	<div class="login-box">
		<div class="login-left">
			<div class="qrcode-login">
				<img src="1.jpg" alt="">
				<div class="qrcode-footer">
					<span id="p1">哇,好阔耐!</span><br>	
					<span>认识一下?</span>

				</div>
			</div>
			
		</div>
		<div class="login-right">
			<input type="text" placeholder="你的手机号/账号/邮箱号" id="username1"><br>
			<input type="text" placeholder="密码" id="post1"><br>
			<span id="randomNum"></span><button onclick="kaixue1()">获取验证码</button><br>
			<input type="text" placeholder="输入验证码" id="randomNum1"><br>	
			<button id="reload">登录</button><button onclick="kaixue()">注册</button>


			
		</div>
	</div>
	<script src="http://libs.baidu.com/jquery/1.11.1/jquery.js"></script>
	<script src="js/demo01.js"></script>
	<script>
		$("#reload").click(function() {
			var  username = $.trim($("#username1").val());
			var  post = $("#post1").val();
			var randomNum = $("#randomNum").html();
			var randomNum1 = $("#randomNum1").val();
			if (!username || !post) {
				alert("账号密码不能为空");
				return;
			}
			if (username.length < 6 || username.length > 15) {
				alert("账号的长度不能大于15或者小于6");
				return;
			}
			if (post.length < 6 || post.length > 15) {
				alert("密码的长度不能大于15或者小于6");
				return;
			}
			if (randomNum != randomNum1) {
				alert("验证码不正确");
				return;
			}
			var url = "http://39.105.222.9:8095/blog/login_user/";
			var pase = {"username":username,"password":post};
			$.post(url,pase,function(data) {
				if (data.result != 1) {
					alert(data.message);
				}else {
					alert(data.message);
					sessionStorage.setItem("token",data.token);
					location.href = "demo03.html";

				}

			})
		})		
	</script>	
</body>
</html>
































